
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			var ar=["nihao","wo","shi","laoliu"];
			//有多少个含有字母a
			let count=0;
			for(let s in ar){
				console.log(s);
				console.log(ar[s]);
				if(ar[s].indexOf("a")>=0)
				  count++;
			}
			// for(let s of ar){
			// 	if(s.indexOf("a")>=0)
			// 	  count++;
			// }
			alert("有"+count+"个含有a");
		</script>
	</head>
	<body>
	</body>
</html>
